package kama;

import java.util.Scanner;

public class Test0057 {
}

class Main0057_1{
    public static void main(String[] args) {
        String[] split = new Scanner(System.in).nextLine().split(" ");
        int count = Integer.parseInt(split[0]);
        int limit = Integer.parseInt(split[1]);

        int[] dp = new int[count + 1];
        dp[0] = 1;

        for (int i = 1; i <= count; i++) {
            for (int j = 1; j <= limit; j++) {
                if (j<=i)dp[i]+=dp[i-j];
            }
        }

        System.out.println(dp[count]);
    }
}
